package com.eastfair.venueservice.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.eastfair.boot.request.PageParams;
import com.eastfair.boot.service.SuperService;
import com.eastfair.venueservice.dto.ServiceInventoryOutFlowDTO;
import com.eastfair.venueservice.dto.ServiceInventoryOutFlowQuery;
import com.eastfair.venueservice.entity.ServiceInventoryOutFlow;
import com.eastfair.venueservice.vo.ServiceInventoryOutFlowVO;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 业务接口
 * 服务库存出库流水记录
 * </p>
 *
 * @author linan
 * @date 2022-09-19
 */
public interface ServiceInventoryOutFlowService extends SuperService<ServiceInventoryOutFlow> {

    /**
     * 插入出库流水
     * @param serviceInventoryOutFlowDTO serviceInventoryOutFlowDTO
     * @return Boolean
     */
    Boolean saveOutFlow(ServiceInventoryOutFlowDTO serviceInventoryOutFlowDTO);

    /**
     * 查询出库记录
     * @param serviceInventoryOutFlowQuery
     * @return
     */
    Page<ServiceInventoryOutFlowVO> queryOutFlowList(PageParams<ServiceInventoryOutFlowQuery> serviceInventoryOutFlowQuery);

    /**
     * 统计主场服务分类出库量.
     *
     * @param exhibitionManageId the exhibition manage id
     * @param homeId             the home id
     * @param topN               the top n
     * @return the list
     */
    List<Map<String, Object>> countServiceCategoryOutFlow(Long exhibitionManageId, Long homeId, Integer topN);

    /**
     * 统计主场服务出库量.
     *
     * @param exhibitionManageId the exhibition manage id
     * @param homeId             the home id
     * @param topN               the top n
     * @return the list
     */
    List<Map<String, Object>> countServiceOutFlow(Long exhibitionManageId, Long homeId, Integer topN);

    /**
     * 导出服务分类出库量.
     *
     * @param exhibitionManageId the exhibition manage id
     * @param homeId             the home id
     * @param response           the response
     */
    void exportServiceCategoryOutFlow(Long exhibitionManageId, Long homeId, HttpServletResponse response) throws IOException;

    /**
     * 导出服务出库量.
     *
     * @param exhibitionManageId the exhibition manage id
     * @param homeId             the home id
     * @param response           the response
     */
    void exportServiceOutFlow(Long exhibitionManageId, Long homeId, HttpServletResponse response) throws IOException;

}
